//
//  BabyGrowPhotoView.m
//  BabyHelper
//
//  Created by  thomas on 11-8-11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "BabyGrowPhotoView.h"
#import "PhotoSet.h"

@implementation BabyGrowPhotoView
@synthesize photoSet = _photoSet;
@synthesize whereClause,photoCategory;

- (void) viewDidLoad {
	self.title = NSLocalizedString(@"Baby Album", @"");	
	//set background image
	self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background"]];
	self.tableView.backgroundColor = [UIColor clearColor];
	//set navigation background color
	self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:navBarRed green:navBarGreen blue:navBarBlue alpha:navBarAlpha];
	
	UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]
								  initWithTitle:NSLocalizedString(@"Edit", @"")
								  style:UIBarButtonItemStyleBordered 
								  target:self
								  action:@selector(toggleShare)		
								  ];
	self.navigationItem.rightBarButtonItem = rightItem;
	[rightItem release];
	self.delegate = self; 

}

-(void)toggleShare{
	
}

- (void)thumbsViewController: (TTThumbsViewController*)controller
              didSelectPhoto: (id<TTPhoto>)photo { 
	NSLog(@"Photo selected"); 
} 

- (void)viewWillAppear:(BOOL)animated {
	
	[super viewWillAppear:animated];
	self.photoSource = [PhotoSet getBabyPhotoSet:self.whereClause photoCategory:self.photoCategory];
	
	//set navigation background color
	self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:navBarRed green:navBarGreen blue:navBarBlue alpha:navBarAlpha];
	//[self setWantsFullScreenLayout:YES];
}

- (void) updateTableLayout { 
	self.tableView.contentInset = UIEdgeInsetsMake(5, 0, 0, 0); 
	self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(TTBarsHeight(), 0, 0, 0); 
}


- (void) dealloc {
    self.photoSet = nil;    
    [super dealloc];
}

@end